//
//  AccountView.m
//  06-Navigation作业
//
//  Created by dllo on 16/7/21.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "AccountView.h"

@implementation AccountView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UIImageView *imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 20, 20)];
        imageView1.image = [UIImage imageNamed:@"4"];
        [self addSubview:imageView1];
        
        UIImageView *imageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 20, 20)];
        imageView2.image = [UIImage imageNamed:@"5"];
        [self addSubview:imageView2];
        
        UITextField *textField1 = [[UITextField alloc] initWithFrame:CGRectMake(42, 0, 300, 40)];
        textField1.placeholder = @"1";
        textField1.text = @"请输入手机号";
        textField1.clearsOnBeginEditing = YES;
        textField1.backgroundColor = [UIColor blackColor];
        textField1.alpha = 0.3;
        textField1.textColor = [UIColor whiteColor];
        
        
        [self addSubview:textField1];
        
        UITextField *textField2 = [[UITextField alloc] initWithFrame:CGRectMake(40, 42, 300, 40)];
        textField2.text = @"请输入验证码";
        textField2.textColor = [UIColor whiteColor];
        textField2.clearsOnBeginEditing = YES;
        textField2.backgroundColor = [UIColor blackColor];
        textField2.alpha = 0.3;
        [self addSubview:textField2];
        
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.frame = CGRectMake(230, 50, 100, 20);
        [button setTitle:@"获取验证码" forState:UIControlStateNormal];
        button.backgroundColor = [UIColor greenColor];
        [self addSubview:button];
        [button addTarget:self action:@selector(buttonClicked) forControlEvents:UIControlEventTouchUpInside];
        
        UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 42, 40)];
        label1.backgroundColor = [UIColor blackColor];
        label1.alpha = 0.4;
        [self addSubview:label1];
        
        UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(0, 42, 42, 40)];
        label2.backgroundColor = [UIColor blackColor];
        label2.alpha = 0.4;
        [self addSubview:label2];
    }
    return self;
}

- (void)buttonClicked
{
    NSLog(@"904586");
}


@end
